/**
 * Copyright 2018-2020 victor & highset (http://www.highset.cn)
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.highset.modules.base.factory;

import cn.highset.modules.base.entity.Banner;

/**
 * 轮播图创建工厂
 */
public class BannerFactory {


    /**
     * 更新轮播图
     */
    public static Banner edit(Banner newBean, Banner oldBean) {
        if (newBean == null || oldBean == null) {
            return oldBean;
        } else {
            oldBean.setTitle(newBean.getTitle());
            oldBean.setImageUrl(newBean.getImageUrl());
            oldBean.setEndpoint(newBean.getEndpoint());
            oldBean.setUrl(newBean.getUrl());
            oldBean.setSortOrder(newBean.getSortOrder());
            return oldBean;
        }
    }

}
